package io.github.aaron.commonadmin.domain;

import org.mybatis.generator.api.dom.java.CompilationUnit;
import org.mybatis.generator.api.dom.java.CompilationUnitVisitor;
import org.mybatis.generator.api.dom.java.FullyQualifiedJavaType;

import java.util.List;
import java.util.Set;

/**
 * @Author aaron01.fan
 * @Date 2025/9/1 18:01
 * @Description 直接提供文件源码
 **/
public class SourceCompilationUnit implements CompilationUnit {

    private final String source;

    private final String fullTypeSpecification;

    public SourceCompilationUnit(String source, String fullTypeSpecification) {
        this.source = source;
        this.fullTypeSpecification = fullTypeSpecification;
    }

    @Override
    public Set<FullyQualifiedJavaType> getImportedTypes() {
        return null;
    }

    @Override
    public Set<String> getStaticImports() {
        return null;
    }

    @Override
    public FullyQualifiedJavaType getType() {
        return new FullyQualifiedJavaType(fullTypeSpecification);
    }

    @Override
    public void addImportedType(FullyQualifiedJavaType importedType) {

    }

    @Override
    public void addImportedTypes(Set<FullyQualifiedJavaType> importedTypes) {

    }

    @Override
    public void addStaticImport(String staticImport) {

    }

    @Override
    public void addStaticImports(Set<String> staticImports) {

    }

    @Override
    public void addFileCommentLine(String commentLine) {

    }

    @Override
    public List<String> getFileCommentLines() {
        return null;
    }

    @Override
    public <R> R accept(CompilationUnitVisitor<R> visitor) {
        return (R) source;
    }
}
